// pages/load/load.js
var app = getApp();
var url = '';
Page({
  data: {
  },
  onShow: function (options) {
    var that = this;
    app.func.req('index/index_type', { app_id: app.app_id }, 'GET', function (res) {
      if (res && res.result.index_types == 2) {
        url = '/pages/index/home';
        wx.setStorageSync('indexType', res.result.index_types);
        wx.setStorageSync('current_index_url', url);
        wx.setStorageSync('hot_title', res.result.hot_title);
      } else {
        url = '/pages/index/index';
        wx.removeStorageSync('indexType');
        wx.removeStorageSync('current_index_url');
        wx.removeStorageSync('hot_title');
      }
      wx.redirectTo({
        url: url
      });
    }, {
        'token': wx.getStorageSync('token')
    });
  }
})
